//
//  ZhuceViewController.m
//  QuicklyPlay
//
//  Created by 郭晓宇 on 15/11/9.
//  Copyright © 2015年 OPteam. All rights reserved.
//

#import "ZhuceViewController.h"
#import "LoginViewController.h"
@interface ZhuceViewController ()

@end

@implementation ZhuceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //密码密文输入:
    self.passwordText.secureTextEntry = YES;
    self.querenPasswordText.secureTextEntry = YES;
    // Do any additional setup after loading the view.
}
//返回按钮的点击方法:
- (IBAction)backTo:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}
//取消按钮的点击方法:
- (IBAction)quxiaoButtonAction:(id)sender {
    
    [self dismissViewControllerAnimated:YES completion:nil];
}
//注册按钮的点击方法:
- (IBAction)zhuceButtonAction:(id)sender {
//    LoginViewController *zhuce = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"LoginVC"];
//    [self presentViewController:zhuce animated:YES completion:nil];
    if ([self.passwordText.text isEqualToString: @"" ] || [self.querenPasswordText.text isEqualToString: @""] || [self.usernameText.text isEqualToString:@""] || [self.emailText.text isEqualToString:@""] || [self.telephoneText.text isEqualToString:@""]) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请检查你的输入内容是否有空值" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    [alert show];
    }else if(![self.passwordText.text isEqualToString: self.querenPasswordText.text]){
    UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:@"提示" message:@"请检查两次输入的密码是否一样" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    [alert1 show];
    }else{
    UIAlertView *alert2 = [[UIAlertView alloc] initWithTitle:@"提示" message:@"恭喜你成为我们大家族的一员" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    [alert2 show];
    }
}
// 点击空白处实现键盘的返回
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.view endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
